package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;

import com.member.common.utils.DateUtils;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizGoodsRankCategoryMapper;
import com.member.shop.domain.SysBizGoodsRankCategory;
import com.member.shop.service.ISysBizGoodsRankCategoryService;

/**
 * 排行榜单分类Service业务层处理
 *
 * @author lixinchen
 * @date 2025-01-13
 */
@Service
public class SysBizGoodsRankCategoryServiceImpl extends ServiceImpl<SysBizGoodsRankCategoryMapper, SysBizGoodsRankCategory> implements ISysBizGoodsRankCategoryService {
    @Resource
    private SysBizGoodsRankCategoryMapper sysBizGoodsRankCategoryMapper;

    /**
     * 查询排行榜单分类
     *
     * @param id 排行榜单分类主键
     * @return 排行榜单分类
     */
    @Override
    public SysBizGoodsRankCategory selectSysBizGoodsRankCategoryById(Long id) {
        return sysBizGoodsRankCategoryMapper.selectById(id);
    }

    /**
     * 查询排行榜单分类列表
     *
     * @param queryWrapper 排行榜单分类
     * @return 排行榜单分类
     */
    @Override
    public List<SysBizGoodsRankCategory> selectSysBizGoodsRankCategoryList(LambdaQueryWrapper<SysBizGoodsRankCategory> queryWrapper) {
        return sysBizGoodsRankCategoryMapper.selectList(queryWrapper);
    }

    @Override
    public List<SysBizGoodsRankCategory> selectSysBizGoodsRankCategoryList(SysBizGoodsRankCategory sysBizGoodsRankCategory) {
        return sysBizGoodsRankCategoryMapper.selectSysBizGoodsRankCategoryList(sysBizGoodsRankCategory);
    }

    /**
     * 新增排行榜单分类
     *
     * @param sysBizGoodsRankCategory 排行榜单分类
     * @return 结果
     */
    @Override
    public int insertSysBizGoodsRankCategory(SysBizGoodsRankCategory sysBizGoodsRankCategory) {
        sysBizGoodsRankCategory.setCreateTime(DateUtils.getNowDate());
        return sysBizGoodsRankCategoryMapper.insert(sysBizGoodsRankCategory);
    }

    /**
     * 修改排行榜单分类
     *
     * @param sysBizGoodsRankCategory 排行榜单分类
     * @return 结果
     */
    @Override
    public int updateSysBizGoodsRankCategory(SysBizGoodsRankCategory sysBizGoodsRankCategory) {
        sysBizGoodsRankCategory.setUpdateTime(DateUtils.getNowDate());
        return sysBizGoodsRankCategoryMapper.updateById(sysBizGoodsRankCategory);
    }

    /**
     * 批量删除排行榜单分类
     *
     * @param ids 需要删除的排行榜单分类主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsRankCategoryByIds(Long[] ids) {
        return sysBizGoodsRankCategoryMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除排行榜单分类信息
     *
     * @param id 排行榜单分类主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsRankCategoryById(Long id) {
        return sysBizGoodsRankCategoryMapper.deleteById(id);
    }
}
